package com.wlyuan.open.scanner.utils.enums.transport;

import com.wlyuan.core.marker.NamedValue;
import com.wlyuan.core.marker.NamedValueMap;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

/**
 * @author lijing
 * @description 运单关闭类型新老系统关系
 */
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum TransportCloseTypeEnum implements NamedValue<Integer> {

    /**
     * 订单错误
     */
    ORDER_ERROR(1, 0, "订单错误"),

    /**
     * 调度错误
     */
    DISPATCH_ERROR(2, 1, "调度错误");

    private final Integer value;
    private final Integer newValue;
    private final String name;


    private static final Map<Integer, TransportCloseTypeEnum> MAP = new NamedValueMap<>(TransportCloseTypeEnum.class);

    public static TransportCloseTypeEnum fromValue(Integer value) {
        return MAP.get(value);
    }
}
